<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>账户管理</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="../../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../../css/Uaccount.css">
</head>
<body>
	<!-- page_box -->
	<div class="page-box">
		<!-- header -->
		<header class="page-header">
			<a href="Ucenter.html" class="back"></a>
			<p class="pege-name">账户管理</p>
		</header>
		<div class="liubai"></div>
		<!-- header /-->
		<!-- login-detailed -->
		<div class="Uaccount">
			<a class="show_name clear"><i></i><span>账户</span><p></p></a>
			<a class="id_card clear"><i></i><span>身份认证</span><em></em><p></p></a><!-- 未实名认证 跳转nameAuthentication.html 已认证不跳转 显示身份证号-->
			<a class="phone_number clear"><i></i><span>手机认证</span><em></em><p></p></a><!-- 未实名认证  跳转nameAuthentication.html -->
			<a class="Email clear"><i></i><span>邮箱认证</span><em></em><p></p></a><!-- 未绑定邮箱跳转BindEmail.html; 已绑定修改跳转modifyEmail.html -->
			<a class="clear bindBank" ><i></i><span>支付账户</span><em></em><p></p></a><!-- 无页面 -->
			<a href="modify-login-password.html" class="clear"><i></i><span>登录密码</span><em></em><p>修改</p></a>
			<a class="clear spp"><i></i><span>支付密码</span><em></em><p></p></a>
			<a class="clear"><i></i><span>手势密码</span><em></em><p>暂未开发</p></a>
		</div>
		<!-- login-detailed / -->
	</div>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/http-url.js"></script>
<script type="text/javascript">
	$(function(){
		ajaxRequest('/api/user/',null,function(data){
			$('.Uaccount').find('.show_name').find('p').text(data.data.user.show_name);
			$('.Uaccount').find('.id_card').find('p').text(data.data.user.id_card==null?"未认证":data.data.user.id_card)
			$('.Uaccount').find('.phone_number').find('p').text(data.data.user.R_phone_number==null?"未绑定":data.data.user.R_phone_number)
			$('.Uaccount').find('.Email').find('p').text(data.data.user.email==null?"未绑定":data.data.user.email)
			$('.Uaccount').find('.bindBank').find('p').text(data.data.user.bind_bank==false?"未开通":'已开通支付账户');
			$('.Uaccount').find('.spp').find('p').text(data.data.user.spp==false?"未设置":'已设置支付密码');
		},true);
		// 验证设置身份证
		isSet('.id_card','nameAuthentication.html');
		// isSet('.phone_number','modifyPhone.html','Set-phone.html');
		isSet('.Email','BindEmail.html','modifyEmail.html');
		isSet('.bindBank','U-addBank.html','U-MyBank.html');
		$('.spp').click(function(){
			ajaxRequest('/api/user/set/payPassword/',null,function(data){
				if (data.m_status==200) {
					window.location.href="SetPassword.html"
				}
			},false)
		});
		// 点击手机号码  判断是否设置支付密码
		$('.phone_number').click(function(){
			ajaxRequest('/api/user',null,function(data){
				if (data.data.user.spp==true) {
					return
				}
				if($('.phone_number').find('p').text().length<=4){
	            	window.location.href='modifyPhone.html'; 
	        	}
	        	if($('.phone_number').find('p').text().length>4){
           		    window.location.href='Set-phone.html';
            	}
			},false)
		})

	});
</script>
</body>
</html>